package com.yt.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Classname OrderZkController
 * @Description
 * @Date 2021/10/19 15:11
 * @Create by 杨涛
 */
@RestController
@Slf4j
public class OrderZkController {
    //后面是微服务注册的服务名
    public static final String URL="http://cloud-pay-service";
    @Resource
    RestTemplate restTemplate;

    @RequestMapping("/getport")
    public String getUser(){
        //get方式 ,可以不带参数，post方式中间是参数对像
        return restTemplate.getForObject(URL+"/getport",String.class);
    }
}
